<?php
header("Content-type: text/css");
$include = explode('--',$_GET['include']);

$alink = explode('|',$include[0]);

$url_base = $alink[0];
$url_prefix = $alink[1];

$atype = explode('|',$include[1]);
$app = $atype[0];
$com = $atype[1];

echo '
@import url(\''.$url_prefix.'app/'.$app.'/view/temp/default/layout/css/ui-lightness/jquery-ui.css\');

@import url(\''.$url_prefix.'app/'.$app.'/view/temp/default/layout/css/styles.css\');
@import url(\''.$url_prefix.'app/admin/view/temp/default/layout/css/editor_form.css\');
@import url(\''.$url_prefix.'app/admin/view/temp/default/layout/css/highslide/highslide.css\');
';
/***load css deafault cho com****/
$file_name =  realpath('../app/'.$app.'/view/temp/default/'.$com.'/'.$com.'.css');
if(file_exists($file_name)){
    echo '@import url(\''.$url_prefix.'app/'.$app.'/view/temp/default/'.$com.'/'.$com.'.css\');';
}

/***load css default cho phan layout****/
$array_css = explode('|',$include[3]);
foreach($array_css as $_css)
{
    $file_name =  realpath('../'. 'app/'.$app.'/view/temp/default/layout/css/'.$_css.'.css');
    if(!empty($_css) && file_exists($file_name))
    {
        echo '@import url(\''.$url_prefix.'app/'.$app.'/view/temp/default/layout/css/'.$_css.'.css\');';
    }
	
}    

/**load css default cho phan module**/
$amod = explode('|',$include[2]);
foreach($amod as $_m)
{   
    $file_name =  realpath('../'. 'app/'.$app.'/view/temp/default/module/'.$_m.'/'.$_m.'.css');
	if(!empty($_m) && file_exists($file_name))
    { 
        
        
    	echo '@import url(\''.$url_prefix.'app/'.$app.'/view/temp/default/module/'.$_m.'/'.$_m.'.css\');';
    }
}


